﻿<Window x:Class="BAC.UI.Engine.BACWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:gif="http://wpfanimatedgif.codeplex.com"

        Title="CRM Bulk Attribute Creator" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="638" Width="1331" Loaded="MyWindow_Loaded" >
    <Window.Resources>
        <Style x:Key ="roundButtonTemplate" TargetType ="{x:Type Button}">
            <Setter Property ="Foreground" Value ="Black"/>
            <Setter Property ="FontWeight" Value ="Bold"/>
            <Setter Property ="Template">
                <Setter.Value>
                    <ControlTemplate TargetType ="{x:Type Button}">
                        <Grid>
                            <Ellipse Name ="OuterRing" Width ="75" Height ="75" Fill ="DarkGreen"/>
                            <Ellipse Name ="InnerRing" Width ="60" Height ="60" Fill ="MintCream"/>
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property ="IsMouseOver" Value ="True">
                                <Setter TargetName ="OuterRing" Property ="Fill" Value ="MediumSeaGreen"/>
                            </Trigger>
                            <Trigger Property ="IsPressed" Value ="True">
                                <Setter TargetName ="OuterRing" Property ="Height" Value ="90"/>
                                <Setter TargetName ="OuterRing" Property ="Width" Value ="90"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


    </Window.Resources>
    <Grid Height="604" Width="1309">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="702*" />
            <ColumnDefinition Width="10*" />
        </Grid.ColumnDefinitions>
        <!--<Image gif:ImageBehavior.AnimatedSource="C:\Users\v-mkum\Documents\Visual Studio 2010\Projects\BulkAttributeCreator\Progress.gif"   />-->

        <TextBox Height="23" HorizontalAlignment="Left" Margin="165,27,0,0" Name="tbFilenName" VerticalAlignment="Top" Width="260" />
        <Button Margin="19,282,0,0" Name="btnSubmit"   Click="btnSubmit_Click" ToolTip="Click to submit data for processing"       
         Height="73" 
        Width="79"
        HorizontalAlignment="Left" 
        VerticalAlignment="Top"
        Background="Transparent"
        BorderBrush="Transparent"
        BorderThickness="0" 
        Padding="-4" >
            <Button.ContentTemplate>
                <DataTemplate >
                    <Image Stretch="Fill"  Source="pack://application:,,,/Images/SubmitSquare.jpg"></Image>
                </DataTemplate>
            </Button.ContentTemplate>
        </Button>
        <Label Content="File Path" Height="28" HorizontalAlignment="Left" Margin="249,0,0,0" Name="lblFileName" VerticalAlignment="Top" Width="61" FontWeight="Bold" />
        <DataGrid AutoGenerateColumns="False" Height="522" HorizontalAlignment="Left" Margin="124,73,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="1169" CurrentCellChanged="dataGrid1_CurrentCellChanged" CellEditEnding="dataGrid1_CellEditEnding" BorderThickness="0" CanUserAddRows="False" Grid.ColumnSpan="2">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Name" Binding="{Binding Path=Name*}" IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Display Name" Binding="{Binding Path=DisplayName*}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Required Level" Binding="{Binding Path=RequiredLevel*}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Type*" Binding="{Binding Path=Type*}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Description" Binding="{Binding Path=Description}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Auditing" Binding="{Binding Path=Auditing}"   IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Field Security" Binding="{Binding Path=FieldSecurity}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Default Value" Binding="{Binding Path=DefaultValue}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Format" Binding="{Binding Path=Format}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Maximum Length" Binding="{Binding Path=MaximumLength}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Maximum Value" Binding="{Binding Path=MaximumValue}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Minimum Value" Binding="{Binding Path=MinimumValue}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Precision" Binding="{Binding Path=Precision}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="IME Mode" Binding="{Binding Path=IMEMode}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTextColumn Header="Options" Binding="{Binding Path=Options}"  IsReadOnly="True"></DataGridTextColumn>
                <DataGridTemplateColumn Header="Lookup Type"  IsReadOnly="False">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Path=LookupType}"></TextBlock>
                            <!--<TextBlock Text="{Binding Path=F16}"></TextBlock>-->
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                    <DataGridTemplateColumn.CellEditingTemplate>
                        <DataTemplate>
                            <ComboBox  Name="cbLookupType"  ItemsSource="{DynamicResource lookupEntityNameResolver}" SelectedValuePath="Value" DisplayMemberPath="Key"
                                      IsSynchronizedWithCurrentItem="False" IsEditable="True" DropDownClosed="cbLookupType_DropDownClosed"  Text="{Binding Key,Mode=OneWay}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellEditingTemplate>
                </DataGridTemplateColumn>
                <DataGridTextColumn Header="Relationship Name" Binding="{Binding Path=RelationshipName}"></DataGridTextColumn>
                <DataGridTextColumn Header="Status" Binding="{Binding Path=Status}"></DataGridTextColumn>
                <!--<DataGridTextColumn Header="Relationship Name" Binding="{Binding Path=F17}"></DataGridTextColumn>-->
            </DataGrid.Columns>
        </DataGrid>

        <ComboBox Height="23" HorizontalAlignment="Right" Margin="0,27,196,0" Name="cbEntity" VerticalAlignment="Top" Width="244" SelectionChanged="cbEntity_SelectionChanged" />
        <Label Content="Entity" Height="28" HorizontalAlignment="Left" Margin="947,0,0,576" Name="lblEntity" VerticalAlignment="Bottom" Width="58" FontWeight="Bold" />
        <Label Content="Publisher" Height="28" HorizontalAlignment="Left" Margin="636,0,0,0" Name="lblPublisher" VerticalAlignment="Top" Width="63" FontWeight="Bold" />
        <ComboBox Height="23" HorizontalAlignment="Right" Margin="0,27,493,0" Name="cbPublisher" VerticalAlignment="Top" Width="247" SelectionChanged="cbPublisher_SelectionChanged" />
        <Button Content="Browse" Height="23" HorizontalAlignment="Right" Margin="0,27,793,0" Name="btnBrowse" VerticalAlignment="Top" Width="76" Click="btnBrowse_Click" ToolTip="Click to select data file" />
        <Button Name="btnConnect" Margin="19,97,0,0" Click="btnConnect_Click" ToolTip="Click to connect to CRM service"
        Height="73" 
        Width="79"
        HorizontalAlignment="Left" 
        VerticalAlignment="Top"
        Background="Transparent"
        BorderBrush="Transparent"
        BorderThickness="0" 
        Padding="-4" >
            <Button.ContentTemplate>
                <DataTemplate >
                    <Image Stretch="Fill"  Source="pack://application:,,,/Images/ConnectSquare.jpg"></Image>
                </DataTemplate>
            </Button.ContentTemplate>
        </Button>
        <Label Content="Not Connected" ToolTip="CRM Service Connection Status" Height="30" HorizontalAlignment="Left" Margin="12,27,0,0" Name="lblConnectionStatus" VerticalAlignment="Top" Width="125" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Foreground="Red" FontWeight="Bold" />
        <Button  Name="btnReset"  Click="btnReset_Click"  Margin="19,187,0,0" ToolTip="Click to Reset the form"
         Height="73" 
        Width="79"
        HorizontalAlignment="Left" 
        VerticalAlignment="Top"
        Background="Transparent"
        BorderBrush="Transparent"
        BorderThickness="0" 
        Padding="-4" >
            <!--<Button.Template>
                <ControlTemplate>
                    <Grid>
                        <Ellipse>
                            <Ellipse.Fill>
                                <ImageBrush ImageSource="pack://application:,,,/Images/ResetSquare.jpg"/>
                            </Ellipse.Fill>
                        </Ellipse>
                    </Grid>
                </ControlTemplate>
            </Button.Template>-->
            <Button.ContentTemplate>
                <DataTemplate >
                    <Image Stretch="Fill"  Source="pack://application:,,,/Images/ResetSquare.jpg"></Image>
                </DataTemplate>
            </Button.ContentTemplate>
        </Button>
        <Label Content="Connection Status" Height="28" HorizontalAlignment="Left" Margin="12,0,0,0" Name="label1" VerticalAlignment="Top" FontWeight="Bold" />
        <Button Name="btnDownload" Margin="19,377,0,0"  ToolTip="Click to download BAC Import template file"
         Height="73" 
        Width="79"
        HorizontalAlignment="Left" 
        VerticalAlignment="Top"
        Background="Transparent"
        BorderBrush="Transparent"
        BorderThickness="0" 
        Padding="-4" Click="btnDownload_Click">
            <Button.ContentTemplate>
                <DataTemplate >
                    <Image Stretch="Fill"  Source="pack://application:,,,/Images/DownloadSquare.jpg"></Image>
                </DataTemplate>
            </Button.ContentTemplate>
        </Button>
    </Grid>
</Window>
